package com.feidee.data.report.util;

import java.text.DecimalFormat;

public class MathUtil {

    public static float divide(int numerator, int denominator) {
        if (denominator == 0) {
            return -1;
        }
        float result = (float) ((numerator * 0.1 / denominator) * 10);
        DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
        format.applyPattern("####.####");
        return Float.parseFloat(format.format(result));
    }

    // public static void main(String args[]) {
    // System.out.println(divide(2, 3));
    // }
}
